﻿<form action="index.php?app=esb&ctl=admin_certificate&act=save" 	method="post" id='esb_form'>
	<h5 class="head-title"><{t}><{$title}><{/t}></h5>
  <input type="hidden" name="node[id]" value=<{$node.id}>>
  <input type="hidden" name="certi[id]" value=<{$certi.id}>>
	<div class="tableform tableform-tabs">
		<{tabber}>
		<div class="division"
			style="padding: 5px; border: 1px solid #dddddd; margin: 1px 0px;">
			<{tab name="基本设置"}>  

			<div class="division" style="padding: 3px; margin: 0;">
				<table>				
					<tr>
						<th align="right"><{t}>联系人:<{/t}></th>
						<td><input type="certi[text]" class='x-input'
							value="<{$certi.truename|escape:html}>"   name="certi[truename]" /> </td>
					</tr>
					<tr>
						<th align="right"><{t}>电话:<{/t}></th>
						<td><input type="certi[text]" class='x-input'
							value="<{$certi.tel|escape:html}>"   name="certi[tel]" /> </td>
					</tr>
					<tr>
						<th align="right"><{t}>手机:<{/t}></th>
						<td><input type="certi[text]" class='x-input'
							value="<{$certi.mobile|escape:html}>"  name="certi[mobile]" /> </td>
					</tr>
					<tr>
						<th align="right"><{t}>公司名称:<{/t}></th>
						<td><input type="certi[text]" class='x-input'
							value="<{$certi.company|escape:html}>"  name="certi[company]" /> </td>
					</tr>
						<tr>
						<th align="right"><{t}>地区:<{/t}></th>
						<td>
						<{input app=ectools type="region"  value=$certi.region  name='certi[region]' vtype='area'}>
					 </td>
					</tr>
					<tr>
						<th align="right"><{t}>公司地址:<{/t}></th>
						<td><input type="certi[text]" class='x-input'
							value="<{$certi.address|escape:html}>"   name="certi[address]" /> </td>
					</tr>
				
					<tr>
						<th align="right"><{t}>授权时间:<{/t}></th>
						<td>
						 		<{input type="date" vtype="date" name="certi[begin_time]"  vtype='required' value=$certi.begin_time}>
<span>至</span>
        <{input type="date" vtype="date" name="certi[end_time]"  value=$certi.end_time}>
					
</tr>
				 
				</table>
			</div>

			<{/tab}>
<{tab name="后端节点设置"}>  
	<div class="division" style="padding: 3px; margin: 0;">
				<table>
					
						<tr>
						<th align="right"><{t}>节点名称:<{/t}></th>
						<td><input type="text" class="x-input" vtype="required"
							name="node[node_name]"  value="<{$node.node_name|escape:html}>">*</td>
					</tr>
					<tr>
						<th align="right"><{t}>节点描述:<{/t}></th>
						<td><input type="text" class="x-input" vtype="required"
							name="node[node_detail]"  value="<{$node.node_detail|escape:html}>">*</td>
					</tr>
					<tr>
						<th align="right"><{t}>节点API:<{/t}></th>
						<td><input type="text" class="x-input" vtype="required"
							name="node[node_api]"  value="<{$node.node_api|escape:html}>">*</td>
					</tr>
					<tr>
						<th align="right"><{t}>节点URL:<{/t}></th>
						<td><input type="text" class="x-input" vtype="required"
							name="node[node_url]"  value="<{$node.node_url|escape:html}>">*</td>
					</tr>
					</table>
					</div>
		<{/tab}>
		</div>
		<{/tabber}>
	</div>

	<div class="table-action"><{button type="button" label="保存"
		id='certi_submit'}></div>
</form>
<script>
	(function() {
		$('esb_form').store('target',{
		    onRequest:function(){
		       $('certi_submit').set('disabled', 'true');
		    },
		    onComplete:function(jsontext){
		       var json = Json.evaluate(jsontext);
		       if (typeof(json.error) != 'undefined'){
		           $('certi_submit').set('disabled', '');
		       }else{
		           $('certi_submit').set('disabled', 'true');
		           opener.finderGroup['<{$env.get.finder_id}>'].refresh.delay(400,opener.finderGroup['<{$env.get.finder_id}>']);
		           window.close();
		       }
		    }
		    });

		$('certi_submit')
				.addEvent(
						'click',
						function() {
							//类型名称不能为空
							/*var bn = $E('#esb_form input[name^=certi[bn]').get('value');
							var certi = $E('#esb_form input[name^=certi[certi]').get('value');
							 var shop = $E('#esb_form select[name^=certi[shop_id]').get('value');
							if (!bn) {
								alert('货号不能为空！');
								return false;
							}
							if (!certi) {
								alert('certi不能为空！');
								return false;
							}
							if (!shop) {
								alert('来源店铺不能为空！');
								return false;
							}*/
							$('esb_form').fireEvent(
									'submit', {
										stop : $empty
									});
						});
	})();
</script>
